#/bin/bash


HOME_DIR=$(cd $(dirname $0);cd ../;pwd)

cd ci
pwd
export GS_PASSWORD='Gauss!23'
export PRIMARYHOST=127.0.0.1
#export STANDBYHOSTS="172.11.0.3,172.11.0.4"
export STANDBYHOSTS=127.0.0.1
export PRIMARYNAME=gaussdb-01 
export STANDBYNAMES=gaussdb-02

export GAUSSHOME=/opt/openGauss
export GAUSSLOG=/opt/data/gausslog
export PGDATA=/opt/data/openGauss
export PGHOST=/opt/data/tmp

function generate_xml() {
    echo "python3 generatexml.py --primary-host=${PRIMARYHOST} --standby-host=${STANDBYHOSTS} --primary-hostname=${PRIMARYNAME} --standby-hostname=${STANDBYNAMES}"
    python3 generatexml.py \
        --primary-host=${PRIMARYHOST} \
        --standby-host=${STANDBYHOSTS} \
        --primary-hostname=${PRIMARYNAME} \
        --standby-hostname=${STANDBYNAMES}
    if [ ! -f "cluster.xml" ]; then
        echo "generate cluster xml file failed."
        exit 1
    fi
    echo "generate cluster xml file success."
}

generate_xml